home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 23 / Amiga Format AFCD23 (Feb 1998, Issue 107).iso / -seriously_amiga- / shareware / workbench / visualprefs / install < prev    next >
Text File  |  1997-12-06  |  13KB  |  458 lines

  1. ;** $VER: VisualPrefsBeta_install 40.10 (7.5.97) by Nik Soggia <nsoggia@telnetwork.it>
  2. ;**
  3. ;** modified (17.5.97) by Massimo Tantignone
  4. ;** modified (13.6.97) by Massimo Tantignone
  5. ;** modified (19.7.97) by Massimo Tantignone
  6. ;** modified (21.7.97) by Massimo Tantignone
  7. ;** modified (24.7.97) by Massimo Tantignone
  8. ;** modified (26.7.97) by Massimo Tantignone
  9. ;** modified (19.10.97) by Massimo Tantignone
  10. ;** modified (22.10.97) by Massimo Tantignone
  11. ;**
  12. ;** requires:
  13. ;** - RexxMast, Rx and Search commands
  14. ;** - T: and ENV: assignments for temporary files
  15.  
  16. ;***************************************
  17. ;** MESSAGES (DEFAULT: ENGLISH)
  18.  
  19. (set msg_rx     "Installer is unable to locate the \"Rx\" command")
  20. (set msg_rxm    "Installer is unable to locate the \"RexxMast\" command")
  21. (set msg_rxp    "Please locate it:")
  22. (set msg_wait   "Checking installation")
  23. (set msg_vpi    "A copy of VisualPrefs is already installed")
  24. (set msg_vpn    "VisualPrefs is not installed")
  25. (set msg_dir    "A drawer WILL NOT be created")
  26. (set msg_seldr  "Select the destination drawer:")
  27. (set msg_selcpu "Select the version of VisualPrefs you want to install.")
  28. (set msg_whdoc  "Where do you want to copy the documentation files?")
  29. (set msg_lang   "What language catalogs do you want to install?")
  30. (set msg_cpu000 "68000")
  31. (set msg_cpu020 "68020/030")
  32. (set msg_cpu040 "68040/060")
  33. (set msg_l_ita  "Italiano")
  34. (set msg_icoo   "Normal icons")
  35. (set msg_icon   "NewIcons")
  36. (set msg_icom   "Magic WB")
  37. (set msg_icoi   "Iconographics")
  38. (set msg_icop   "Select icon set")
  39. (set msg_exa    "Install example preferences?")
  40. (set msg_done   "VisualPrefs will be available next time you boot.")
  41. (set msg_done2  "\n\nIf you use them, you should remove Prop3D and\nCenterTitles from your User-startup.")
  42. (set rxhelp     "Use the file requester to select the \"Rx\" program.")
  43. (set rxmhelp    "Use the file requester to select the \"RexxMast\" program.")
  44. (set dirhelp    "Select the drawer into which VisualPrefs is to be copied.\nIt should reside in the system command path.")
  45. (set dirhelp2   "Select the drawer into which the documentation is to be copied.\nThe default is the same drawer which VisualPrefs resides in.")
  46. (set cpuhelp    "If you have an accelerated Amiga, you can choose to\ninstall a more optimized version of VisualPrefs and\nits preferences editor.")
  47. (set langhelp   "Choose one or more languages for VisualPrefs and the GUI editor.\nYou can later select which one to use with the Locale preferences editor.")
  48. (set iconhelp   "Choose the style for the icons to be installed.")
  49. (set exahelp    "If you select \"Yes\", an example preferences file (preset) will be copied into your SYS:Prefs/Presets drawer.")
  50. (set var_docd   "DocsEnglish")
  51. (set var_docr   "VisualPrefs.guide")
  52. ;(set var_docc   "Changes")
  53.  
  54. ;***************************************
  55. ;** MESSAGES (ITALIANO)
  56.  
  57. (if (= @language   "italiano")(
  58.    (set msg_rx     "Installer non è in grado di trovare il comando \"Rx\"")
  59.    (set msg_rxm    "Installer non è in grado di trovare il comando \"RexxMast\"")
  60.    (set msg_rxp    "Per favore, localizzatelo:")
  61.    (set msg_wait   "Verifica installazione")
  62.    (set msg_vpi    "Una copia di VisualPrefs è già installata")
  63.    (set msg_vpn    "VisualPrefs non è installato")
  64.    (set msg_dir    "NON verrà creato alcun cassetto")
  65.    (set msg_seldr  "Scegliere il cassetto di destinazione:")
  66.    (set msg_selcpu "Scegliere la versione di VisualPrefs da installare.")
  67.    (set msg_whdoc  "Dove volete che siano copiati i file della documentazione?")
  68.    (set msg_lang   "Per quali lingue deve essere installato un catalog?")
  69.    (set msg_cpu000 "68000")
  70.    (set msg_cpu020 "68020/030")
  71.    (set msg_cpu040 "68040/060")
  72.    (set msg_l_ita  "Italiano")
  73.    (set msg_icoo   "Normali")
  74.    (set msg_icon   "NewIcons")
  75.    (set msg_icom   "Magic WB")
  76.    (set msg_icoi   "Iconographics")
  77.    (set msg_icop   "Selezionare il set di icone")
  78.    (set msg_exa    "Installare preferenze di esempio?")
  79.    (set msg_done   "VisualPrefs sarà disponibile dopo il prossimo reboot.")
  80.    (set msg_done2  "\n\nSe li usate, dovreste rimuovere Prop3D e\nCenterTitles dalla vostra User-startup.")
  81.    (set rxhelp     "Usate il file requester per selezionare il programma \"Rx\".")
  82.    (set rxmhelp    "Usate il file requester per selezionare il programma \"RexxMast\".")
  83.    (set dirhelp    "Selezionare il cassetto in cui deve essere copiato VisualPrefs.\nDovrebbe trovarsi nel path dei comandi di sistema.")
  84.    (set dirhelp2   "Selezionare il cassetto in cui deve essere copiata la documentazione.\nIl default è lo stesso cassetto in cui si trova VisualPrefs.")
  85.    (set cpuhelp    "Se avete un Amiga accelerato potete scegliere di\ninstallare versioni più ottimizzate di VisualPrefs\ne del suo editor di preferenze.")
  86.    (set langhelp   "Scegliere una o più lingue per VisualPrefs e l'editor GUI.\nIn seguito si potrà scegliere quale usare con l'editor di preferenze Locale.")
  87.    (set iconhelp   "Scegliere lo stile per le icone da installare.")
  88.    (set exahelp    "Selezionando \"Sì\" verrà copiato un file di preferenze di esempio (preset) nel vostro cassetto SYS:Prefs/Presets.")
  89.    (set var_docd   "DocsItaliano")
  90.    (set var_docr   "VisualPrefs.guide")
  91.    ;(set var_docc   "Cambiamenti")
  92. ))
  93.  
  94. ;***************************************
  95. ;** LOCATE AREXX PROGRAMS
  96.  
  97. (if (= 1 (exists "sys:rexxc/rx" (noreq)))
  98.    (set var_rx "sys:rexxc/rx")
  99.    (if (= 1 (exists "c:rx" (noreq)))
  100.       (set var_rx "c:rx")
  101.       (set var_rx
  102.          (askfile
  103.             (default "SYS:RexxC/Rx")
  104.             (help rxhelp)
  105.             (prompt msg_rx ".\n\n" msg_rxp)
  106.          )
  107.       )
  108.    )
  109. )
  110.  
  111. (set var_rxm (tackon (pathonly var_rx) "rexxmast"))
  112.  
  113. (if (= 0 (exists var_rxm (noreq)))
  114.    (if (= 1 (exists "sys:rexxc/rexxmast" (noreq)))
  115.       (set var_rxm "sys:rexxc/rexxmast")
  116.       (if (= 1 (exists "c:rexxmast" (noreq)))
  117.          (set var_rxm "c:rexxmast")
  118.          (if (= 1 (exists "sys:system/rexxmast" (noreq)))
  119.             (set var_rxm "sys:system/rexxmast")
  120.             (set var_rxm
  121.                (askfile
  122.                   (default "SYS:System/RexxMast")
  123.                   (help rxmhelp)
  124.                   (prompt msg_rxm ".\n\n" msg_rxp)
  125.                )
  126.             )
  127.          )
  128.       )
  129.    )
  130. )
  131.  
  132. (run var_rxm)
  133.  
  134. ;***************************************
  135. ;** CHECK PREVIOUS INSTALLATION
  136.  
  137. (working "(" msg_wait ")")
  138.  
  139. (delete "t:installvp.rx" (optional force) (safe))
  140. (textfile
  141.    (safe)
  142.    (dest "t:installvp.rx")
  143.    (append (cat
  144.       "/* filter */\n"
  145.       "\n"
  146.       "pull string\n"
  147.       "\n"
  148.       "comment=pos(';',string)\n"
  149.       "if comment~==0 then string=trim(left(string,comment-1))\n"
  150.       "say right(string,length(string)-lastpos(' ',string))\n"
  151.    ))
  152. )
  153.  
  154. (delete "t:installvp.sh" (optional force) (safe))
  155. (textfile
  156.    (safe)
  157.    (dest "t:installvp.sh")
  158.    (append (cat
  159.       "delete force t:installvp.out\n"
  160.       "\n"
  161.       "search >t:installvp.out search visualprefs S:Startup-sequence\n"
  162.       "if $RC eq 0\n"
  163.       "   setenv installvp_vp 1\n"
  164.       "   setenv installvp_vpp `" var_rx " <t:installvp.out t:installvp.rx`\n"
  165.       "else\n"
  166.       "   setenv installvp_vp 0\n"
  167.       "   setenv installvp_vpp \"\"\n"
  168.       "endif\n"
  169.       "delete t:installvp.out\n"
  170.       "\n"
  171.    ))
  172. )
  173.  
  174. (execute "t:installvp.sh" (safe))
  175. (delete "t:installvp.rx" (safe))
  176. (delete "t:installvp.sh" (safe))
  177.  
  178. (set var_vp (getenv "installvp_vp"))
  179. (set var_vpp (getenv "installvp_vpp"))
  180. (run "unsetenv installvp_vp")
  181. (run "unsetenv installvp_vpp")
  182.  
  183. (if (= 1 var_vp)
  184.    (
  185.       (set @default-dest (pathonly var_vpp))
  186.       (set msg_vp msg_vpi)
  187.    )
  188.    (set msg_vp msg_vpn)
  189. )
  190.  
  191. (complete 5)
  192.  
  193. (set no_break_warning
  194.    (askdir
  195.       (default @default-dest)
  196.       (help dirhelp)
  197.       (prompt (cat msg_vp ".\n" msg_dir ".\n\n" msg_seldr))
  198.    )
  199. )
  200. (set @default-dest (tackon no_break_warning ""))
  201.  
  202. (set docdir
  203.    (askdir
  204.       (default @default-dest)
  205.       (help dirhelp2)
  206.       (prompt (cat msg_whdoc "\n\n" msg_seldr))
  207.    )
  208. )
  209. (set docdir (tackon docdir ""))
  210.  
  211. ;***************************************
  212. ;** ASK INSTALLATION PREFERENCES
  213.  
  214. (complete 10)
  215.  
  216. (set var_cpu
  217.    (askchoice
  218.       (prompt msg_selcpu)
  219.       (help cpuhelp)
  220.       (choices msg_cpu000 msg_cpu020 msg_cpu040)
  221.    )
  222. )
  223.  
  224. (complete 12)
  225.  
  226. (set var_lang
  227.    (askoptions
  228.       (prompt msg_lang)
  229.       (help langhelp)
  230.       (choices msg_l_ita)
  231.       (default 1)
  232.    )
  233. )
  234.  
  235. (complete 14)
  236.  
  237. (set var_icon
  238.    (askchoice
  239.       (prompt msg_icop)
  240.       (help iconhelp)
  241.       (choices msg_icoo msg_icon msg_icom msg_icoi)
  242.    )
  243. )
  244.  
  245. (complete 16)
  246.  
  247. (set var_exa
  248.    (askbool
  249.       (prompt msg_exa)
  250.       (help exahelp)
  251.    )
  252. )
  253.  
  254. ;***************************************
  255. ;** INSTALL FILES: VISUALPREFS
  256.  
  257. (complete 20)
  258.  
  259. (copyfiles
  260.    (source "VisualPrefs")
  261.    (dest "RAM:")
  262.    (newname "VP_000")
  263.    (safe)
  264. )
  265.  
  266. (if (= 0 var_cpu)(
  267.    (copyfiles (source "RAM:VP_000") (dest "RAM:") (newname "VP_0x0") (safe))
  268. ))
  269.  
  270. (if (= 1 var_cpu)(
  271.    (run "InstallTools/SPatch > NIL: -oRAM:VP_0x0 -pInstallFiles/VisualPrefs_020_030.pch RAM:VP_000" (safe))
  272. ))
  273.  
  274. (if (= 2 var_cpu)(
  275.    (run "InstallTools/SPatch > NIL: -oRAM:VP_0x0 -pInstallFiles/VisualPrefs_040_060.pch RAM:VP_000" (safe))
  276. ))
  277.  
  278. (delete "RAM:VP_000" (safe))
  279.  
  280. (copyfiles
  281.    (source "RAM:VP_0x0")
  282.    (dest @default-dest)
  283.    (newname "VisualPrefs")
  284.    (infos) (noposition)
  285. )
  286.  
  287. (delete "RAM:VP_0x0" (safe))
  288.  
  289. ;***************************************
  290. ;** INSTALL FILES: DOCUMENTATION
  291.  
  292. (complete 30)
  293.  
  294. (copyfiles
  295.    (source (tackon var_docd ""))
  296.    (dest docdir)
  297.    (all) (infos) (noposition)
  298. )
  299.  
  300. ;***************************************
  301. ;** INSTALL FILES: GUI-PREFS
  302.  
  303. (complete 40)
  304.  
  305. (copyfiles
  306.    (source "Prefs/GUI")
  307.    (dest "RAM:")
  308.    (newname "GUI_000")
  309.    (safe)
  310. )
  311.  
  312. (if (= 0 var_cpu)(
  313.    (copyfiles (source "RAM:GUI_000") (dest "RAM:") (newname "GUI") (safe))
  314. ))
  315.  
  316. (if (= 1 var_cpu)(
  317.    (run "InstallTools/SPatch > NIL: -oRAM:GUI -pInstallFiles/GUI_020_030.pch RAM:GUI_000" (safe))
  318. ))
  319.  
  320. (if (= 2 var_cpu)(
  321.    (run "InstallTools/SPatch > NIL: -oRAM:GUI -pInstallFiles/GUI_040_060.pch RAM:GUI_000" (safe))
  322. ))
  323.  
  324. (delete "RAM:GUI_000" (safe))
  325.  
  326. (copyfiles
  327.    (source "RAM:GUI")
  328.    (dest "SYS:Prefs/")
  329.    (noposition)
  330. )
  331.  
  332. (copyfiles
  333.    (source "Prefs/GUI.info")
  334.    (dest "SYS:Prefs/")
  335.    (noposition)
  336. )
  337.  
  338. (delete "RAM:GUI" (safe))
  339.  
  340. ;***************************************
  341. ;** INSTALL FILES: CATALOGS
  342.  
  343. (complete 50)
  344.  
  345. (if (bitand var_lang 1)
  346.    (
  347.       (copyfiles
  348.          (source "Catalogs/italiano/gui.catalog")
  349.          (dest "LOCALE:Catalogs/italiano/")
  350.       )
  351.    )
  352. )
  353.  
  354. ;***************************************
  355. ;** INSTALL FILES: ICONS
  356.  
  357. (complete 60)
  358.  
  359. (if (= 1 var_icon)(
  360.    (copyfiles
  361.       (source "NewIcons/GUI.info")
  362.       (dest "SYS:Prefs/")
  363.       (noposition)
  364.    )
  365.    (copyfiles
  366.       (source "NewIcons/doc.info")
  367.       (dest docdir)
  368.       (newname (cat var_docr ".info"))
  369.       (noposition)
  370.    )
  371. ;   (copyfiles
  372. ;      (source "NewIcons/doc.info")
  373. ;      (dest docdir)
  374. ;      (newname (cat var_docc ".info"))
  375. ;      (noposition)
  376. ;   )
  377. ))
  378.  
  379. (if (= 2 var_icon)(
  380.    (copyfiles
  381.       (source "MagicWB/GUI.info")
  382.       (dest "SYS:Prefs/")
  383.       (noposition)
  384.    )
  385.    (copyfiles
  386.       (source "MagicWB/doc.info")
  387.       (dest docdir)
  388.       (newname (cat var_docr ".info"))
  389.       (noposition)
  390.    )
  391. ;   (copyfiles
  392. ;      (source "MagicWB/doc.info")
  393. ;      (dest docdir)
  394. ;      (newname (cat var_docc ".info"))
  395. ;      (noposition)
  396. ;   )
  397. ))
  398.  
  399. (if (= 3 var_icon)(
  400.    (copyfiles
  401.       (source "Iconographics/GUI.info")
  402.       (dest "SYS:Prefs/")
  403.       (noposition)
  404.    )
  405.    (copyfiles
  406.       (source "Iconographics/doc.info")
  407.       (dest docdir)
  408.       (newname (cat var_docr ".info"))
  409.       (noposition)
  410.    )
  411. ;   (copyfiles
  412. ;      (source "Iconographics/doc.info")
  413. ;      (dest docdir)
  414. ;      (newname (cat var_docc ".info"))
  415. ;      (noposition)
  416. ;   )
  417. ))
  418.  
  419. ;***************************************
  420. ;** INSTALL FILES: SAMPLE PREFS
  421.  
  422. (complete 70)
  423.  
  424. (if (= 1 var_exa)
  425.    (copyfiles
  426.       (source "Prefs/Presets/")
  427.       (dest "SYS:Prefs/Presets/")
  428.       (all) (infos) (noposition)
  429.    )
  430. )
  431.  
  432. ;***************************************
  433. ;** INSTALL FILES: NEW PREFERENCES FILE
  434.  
  435. ;(complete 80)
  436.  
  437. ;(rename "ENVARC:Sys/gui.prefs" "ENVARC:Sys/beta_gui.prefs")
  438. ;(run "InstallTools/ConvertGUIPrefs > NIL: ENVARC:Sys/beta_gui.prefs ENVARC:Sys/gui.prefs")
  439.  
  440. ;***************************************
  441. ;** STARTUP-SEQUENCE
  442.  
  443. (complete 90)
  444.  
  445. (if (= 0 var_vp)
  446.    (
  447.       (run (cat "InstallTools/AddLine \"" @default-dest "\""))
  448.       (protect "S:Startup-sequence" "+srwd")
  449.    )
  450. )
  451.  
  452. ;***************************************
  453. ;** DONE
  454.  
  455. (complete 100)
  456. (exit (cat "\n" msg_done msg_done2))
  457.  
  458.